<template>
   <div id="app">
      我是首页  <br />
      {{num}} --{{total}}<br />
      <button @click="btn">点击</button><br />
      <button @click="btn2">点击</button>
   </div>
</template>
<script setup>
import {computed} from 'vue'
import {useStore} from 'vuex'
let store = useStore()
console.log(1,store)
// let num = store.state.num
//测试getters
let total = store.getters.total

//测试mutations  响应式
let num = computed(()=>store.state.num)
const btn = ()=>{
  store.commit("changeValue",3000)
}

//测试actions
const btn2 = ()=>{
  store.dispatch("changeNum")
}
</script>
<style>
</style>


 
 
